{extend name="common/base"}

{block name="title"}Mine Page{/block}

{block name="stylesheet"}
<style>
.summary {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
</style>
{/block}

{block name="body"}
{include file="common/navbar"}
<div class="row">
    {include file="common/leftbar"}
    <div class="col-md-10">
        <ol class="breadcrumb">
            <li>我的图库</li>
        </ol>
        <div class="col-md-12">
            <button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target="#myModal">新建图库</button>
        </div>
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">新建图库</h4>
                    </div>
                    <form action="{:url('create')}" method="post">
                        <div class="modal-body">
                            <div class="form-group">
                                <label for="name" class="control-label">图库名称</label>
                                <input type="text" class="form-control" id="name" name="name" placeholder="图库名称">
                            </div>
                            <div class="form-group">
                                <label for="summary" class="control-label">图库描述</label>
                                <textarea class="form-control" id="summary" name="summary" placeholder="图库描述"></textarea>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                            <input type="submit" class="btn btn-success" value="Create">
                        </div>
                    </form>
                </div>
            </div>
        </div>
        {volist name="galleries" id="vo"}
        <div class="col-md-4">
            <div class="thumbnail" style="height: 520px">
                <a href="{:url('show', ['id' => $vo.id])}">
                    <img src="__ROOT__/uploads/{$vo.cover}" alt="galleries">
                </a>
                <div class="caption">
                    <h2>{$vo.name}</h2>
                    <p class="summary">{$vo.summary}</p>
                    <p><b>创建时间：</b>{$vo.create_time}</p>
                    <p><b>上次修改：</b>{$vo.update_time}</p>
                    <p>
                        <a href="{:url('edit', ['id' => $vo.id])}" class="btn btn-primary">编辑</a>
                        <a href="{:url('delete', ['id' => $vo.id])}" class="btn btn-danger">删除</a>
                        <a href="{:url('release', ['id' => $vo.id])}" class="btn btn-warning">{if condition="$vo.status"}取消发布{else /}发布{/if}</a>
                    </p>
                </div>
            </div>
        </div>
        {/volist}
    </div>
</div>
{/block}

{block name="script"}
<script>
    $('#mine').addClass('active')
</script>
{/block}
